<?php
use app\assets\AppAsset;
use yii\helpers\Html;
use yii\helpers\Url;
AppAsset::register($this);
$this->registerCssFile('@web/css/sqwrite.css',['depends'=>['app\assets\AppAsset']]);
$this->registerJSFile('@web/js/writecum.js',['depends'=>['app\assets\AppAsset']]);
$this->registerJSFile('@web/js/time.js',['depends'=>['app\assets\AppAsset']]);

?>
<script type="text/javascript">
	<?php
	$session=Yii::$app->session;
	$session->open();
	?>
    var current_userid=<?=$session['user_id'];?>;
	var que_info={
		class1:'<?=$write_content['class1_id'];?>',
		class2:'<?=$write_content['class2_id'];?>',
		question:'<?=$write_content['id'];?>',
		tnum:'0'};
</script>
<div class="container">
	<div class="total-info">
		<span>
            TPO <?=$write_content['class_num'];?>
			<?=$write_content['class_name'];?>
			Question
			<?=$write_content['tnum'];?>
		</span>
	</div>
	<div class="total-part">
		<div class="total-lead clearfix">
			<span class="top-que pull-left">
				<span>
			        <?=$write_content['class_name'];?>
					TPO
					<?=$write_content['class_num'];?>
		</span>
			</span>
			<?php
			$session=Yii::$app->session;
			$session->open();
			if($write_person)
			{
			?>
				<span class="time pull-left">
					<?php
					$session=Yii::$app->session;
					$session->open();
					$session['begin_time'];
					$now=time();
					$session['begin_end_time']=$now-$session['begin_time'];
					?>
					练习耗时: <span id="cost-time">
						<?=$write_person['time'];?>
					</span>
				</span>
				<span class="repeat-doit pull-right">
					<i class="fa fa-rotate-left"></i>
					&nbsp;&nbsp;<a href="<?= Url::to('@web/?r=writing/index&id='.$write_content['id']); ?>">重做本篇</a>
				</span>
		    <?php
			}
			?>
		</div>
		<div class="main-part clearfix">
			<div class="col-xs-5 users">
				<div class="player">
					<div class="audio">
						<div class="audio-play">
							<div class="audio-control clearfix">
								<div class="pause-play pull-left">
									<span><i class="fa fa-play"></i></span>
								</div>
								<div class="audio-time pull-left clearfix">
									<div class="start-time pull-left">00:00</div>
									<div class="play-line pull-left">
										<div class="play-current-line"></div>
										<div class="play-point"></div>
									</div>
									<div class="end-time pull-left">14:00</div>
								</div>
								<div class="audio-volume pull-left clearfix">
									<div class="volume-icon pull-left">
										<span><img src="<?=Url::to("@web/images/6.png");?>"></span>
									</div>
									<div class="volume-line pull-left">
										<div class="volume-current-line"></div>
										<div class="volume-point"></div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="que-wrap">
					<div class="text-head clearfix">
						<div class="text-article textbc pull-left">题目文章</div>
						<div class="text-info pull-left">听力原文</div>
					</div>
					<div class="listen-wrap hidden" id="listen_wrap">
						<p class="total-que">
							<span class="main-lead-que">
							</span>
						</p>
							<!--听力原文--><p class="que-text">
								<?= $write_content['hearing_content']; ?>
						</p>
					</div>
					<div class="text-wrap" id="text_wrap">
						<p class="total-que">question<br>
							<span class="main-lead-que">
								<?php //todo?>
							</span>
						</p>
						<!--题目文章--><p class="que-text">
							<?=$write_content['question'];?>
							<?= $write_content['reading_content']; ?>
						</p>
					</div>
				</div>
				<div class="hot-voice">
					<div class="hot-lead"><i class="fa fa-fire"></i>&nbsp;&nbsp;热门题解</div>
					<div class="add-more">
						<span>加载更多</span>
					</div>
				</div>
			</div>
			<div class="col-xs-7 ques">
				<div class="word-count">
					<span>word count: <span id="countnum">391</span></span>
				</div>
				<div class="userwrite-text">
					<div class="user-write clearfix">
						<div class="my-record">
							<span>我的题解</span>
						</div>
						<div class="record-text">
							<div id="user-composition" class="user-composition" contenteditable="true">
								<?=\yii\helpers\HtmlPurifier::process($write_person_content1['content']);?>
							</div>
						</div>
						<?php
						if($write_person) {
							?>
							<div class="share pull-right">
								分享 <span>Share</span>
							</div>
							<span id="comment-succeed">
								<img src="<?=Url::to('@web/images/updating.gif');?>" alt="上传中...">
								<span>updating...</span>
							</span>
							<?php
						}
						?>
					</div>
				</div>
			</div>
		</div>
	</div>
	<?php
	$session = \Yii::$app->session;
	$session->open();
	if($session['complete']==true) {
		?>
		<audio src="<?= $write_content['url']; ?>"></audio>
		<?php
	}
	?>
</div>
<div class="hidden" id="voicemodel">
	<div class="user-lead clearfix">
		<div class="user-info pull-left clearfix">
			<div class="user-pic pull-left">
				<img src="<?=Url::to('@web/images/timg.jpg');?>">
			</div>
			<div class="user-id-date pull-left">
				<span class="user-id"></span><br>
				<span class="user-date"></span>
			</div>
		</div>
		<div class="good-times pull-right" title="点赞量">
			<span><i class="fa fa-thumbs-o-up"></i>&nbsp;&nbsp;<span class="goods"></span></span>
		</div>
		<div class="view-times pull-right" title="浏览量">
			<span><i class="fa fa-eye"></i>&nbsp;&nbsp;<span class="views"></span></span>
		</div>
	</div>
	<div class="user-comments">
		<span class="usercomment"></span>
		<div class="allchart">
			<div class="chartone">
				文章总观点:&nbsp;&nbsp;<span></span>
				<ul>
					<li>第一方面:&nbsp;&nbsp;<span></span></li>
					<li>第二方面:&nbsp;&nbsp;<span></span></li>
					<li>第三方面:&nbsp;&nbsp;<span></span></li>
				</ul>
			</div>
			<div class="charttwo">
				听力总观点:&nbsp;&nbsp;<span></span>
				<ul>
					<li>第一方面:&nbsp;&nbsp;<span></span></li>
					<li>第二方面:&nbsp;&nbsp;<span></span></li>
					<li>第三方面:&nbsp;&nbsp;<span></span></li>
				</ul>
			</div>
		</div>
	</div>
	<div class="view-all center-block">点击查看全文</div>
</div>
<script type="text/javascript">
	window.onload=function() {
		<?php
		$session=Yii::$app->session;
		$session->open();
		?>
		$('#cost-time').html(secToMin(<?=$write_person['time'];?>));
	};
</script>